/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainFrame.java
 *
 * Created on 5/10/2009, 3:54:45 AM
 */

package nz.ac.massey.spidernetpn.gui;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;

import org.apache.commons.collections15.Transformer;

import edu.uci.ics.jung.algorithms.layout.AbstractLayout;
import edu.uci.ics.jung.algorithms.layout.FRLayout2;
import edu.uci.ics.jung.algorithms.layout.Layout;
import edu.uci.ics.jung.graph.DirectedGraph;
import edu.uci.ics.jung.visualization.BasicVisualizationServer;
import edu.uci.ics.jung.visualization.GraphZoomScrollPane;
import edu.uci.ics.jung.visualization.VisualizationViewer;
import edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse;
import edu.uci.ics.jung.visualization.decorators.ToStringLabeller;
import edu.uci.ics.jung.visualization.renderers.Renderer;

import nz.ac.massey.spidernetpn.database.GraphDatabase;
import nz.ac.massey.spidernetpn.webcrawler.FoundMaxException;
import nz.ac.massey.spidernetpn.webcrawler.WebCrawler;

/**
 *
 * @author Eric
 */
public class MainFrame extends javax.swing.JFrame {

    /** Creates new form MainFrame */
    public MainFrame() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

    	mainPanel = new javax.swing.JPanel();
        optionPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        urlField = new javax.swing.JTextField();
        urlField.setText("http://www.google.com");
        goButton = new javax.swing.JButton();
        stopButton = new javax.swing.JButton();
        redrawButton = new javax.swing.JButton();
        advanceButton = new javax.swing.JButton();
        useProxyCheck = new javax.swing.JCheckBox();
        optionLabel = new javax.swing.JLabel();
        maxDepthLabel = new javax.swing.JLabel();
        maxDepthField = new javax.swing.JTextField();
        maxNodeLabel = new javax.swing.JLabel();
        maxNodeField = new javax.swing.JTextField();
        graphDetailLabel = new javax.swing.JLabel();
        graphDetailComboBox = new javax.swing.JComboBox();
        graphPanel = new javax.swing.JPanel();
        statusPanel = new javax.swing.JPanel();
        nodeCountLabel = new javax.swing.JLabel();
        countLabel = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        newOption = new javax.swing.JMenuItem();
        loadOption = new javax.swing.JMenuItem();
        saveOption = new javax.swing.JMenuItem();
        exitMenu = new javax.swing.JMenuItem();
        optionMenu = new javax.swing.JMenu();
        placeholderAction = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Web Crawler");
        setName("Main Frame"); // NOI18N
        
        mainPanel.setName("mainPanel"); // NOI18N



        
        
        
        jLabel1.setText(" URL :");

        goButton.setText("Go");
        goButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                goButtonActionPerformed(evt);
            }
        });

        stopButton.setText("Stop");
        stopButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                stopButtonActionPerformed(evt);
            }
        });

        redrawButton.setText("Redraw");
        redrawButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                redrawButtonActionPerformed(evt);
            }
        });

        advanceButton.setText("Advanced");
        advanceButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                advanceButtonActionPerformed(evt);
            }
        });

        useProxyCheck.setText("Use Proxy");

        optionLabel.setText(" Options:");

        maxDepthLabel.setText(" Max Depth");
        this.maxDepthField.setText("5");

        maxNodeLabel.setText(" Max Node");
        this.maxNodeField.setText("75");

        graphDetailLabel.setText(" Graph Detail");

        graphDetailComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout optionPanelLayout = new javax.swing.GroupLayout(optionPanel);
        optionPanel.setLayout(optionPanelLayout);
        optionPanelLayout.setHorizontalGroup(
            optionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionPanelLayout.createSequentialGroup()
                .addGroup(optionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(optionPanelLayout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(urlField, javax.swing.GroupLayout.PREFERRED_SIZE, 399, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(goButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(stopButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(redrawButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(advanceButton)
                        .addGap(18, 18, 18)
                        .addComponent(useProxyCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(optionPanelLayout.createSequentialGroup()
                        .addComponent(optionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(maxDepthLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(maxDepthField, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(32, 32, 32)
                        .addComponent(maxNodeLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(maxNodeField, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(46, 46, 46)
                        .addComponent(graphDetailLabel)
                        .addGap(18, 18, 18)
                        .addComponent(graphDetailComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(29, Short.MAX_VALUE))
        );
        optionPanelLayout.setVerticalGroup(
            optionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionPanelLayout.createSequentialGroup()
                .addGroup(optionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(urlField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(goButton)
                    .addComponent(stopButton)
                    .addComponent(redrawButton)
                    .addComponent(advanceButton)
                    .addComponent(useProxyCheck))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(optionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(optionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(maxDepthLabel)
                    .addComponent(maxDepthField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(maxNodeLabel)
                    .addComponent(maxNodeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(graphDetailLabel)
                    .addComponent(graphDetailComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

       // graphPanel.setBackground(new java.awt.Color(255, 255, 255));

       // graphPanel.setBounds();        
//        javax.swing.GroupLayout graphPanelLayout = new javax.swing.GroupLayout(graphPanel);
//        graphPanel.setLayout(graphPanelLayout);
//        graphPanelLayout.setHorizontalGroup(
//            graphPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGap(0, 875, Short.MAX_VALUE)
//        );
//        graphPanelLayout.setVerticalGroup(
//            graphPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGap(0, 494, Short.MAX_VALUE)
//        );

        nodeCountLabel.setText(" Node Count:");

        countLabel.setText("0");

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(nodeCountLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(countLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(754, Short.MAX_VALUE))
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(nodeCountLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
                .addComponent(countLabel))
        );

        fileMenu.setText("File");

        newOption.setText("New");
        newOption.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newOptionActionPerformed(evt);
            }
        });
        fileMenu.add(newOption);

        loadOption.setText("Load");
        loadOption.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                loadOptionActionPerformed(evt);
            }
        });
        fileMenu.add(loadOption);

        saveOption.setText("Save");
        saveOption.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveOptionActionPerformed(evt);
            }
        });
        fileMenu.add(saveOption);

        exitMenu.setText("Exit");
        exitMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuActionPerformed(evt);
            }
        });
        fileMenu.add(exitMenu);

        menuBar.add(fileMenu);

        optionMenu.setText("Option");

        placeholderAction.setText("Placeholder");
        placeholderAction.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                placeholderActionActionPerformed(evt);
            }
        });
        optionMenu.add(placeholderAction);

        menuBar.add(optionMenu);

        setJMenuBar(menuBar);
        
        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(optionPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(graphPanel,  javax.swing.GroupLayout.DEFAULT_SIZE, 1000, Short.MAX_VALUE)
            .addComponent(statusPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addComponent(optionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(graphPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 800, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statusPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        this.add(mainPanel);
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void redrawButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_redrawButtonActionPerformed
        // TODO add your handling code here:
        System.out.println("Redraw Button Pressed");
        RedrawGraph();
    }//GEN-LAST:event_redrawButtonActionPerformed

	private static WebCrawler crawler;
	private DirectedGraph<URL,Integer> graph;
	private GraphDatabase graphDB = new GraphDatabase();
	private BasicVisualizationServer<URL, Integer> vs;
    
    private void setupWebCrawler(){
    	
    	//crawler = new WebCrawler(this.useProxyCheck.isSelected());
    	crawler = null;
    	graph = null;
    	crawler = new WebCrawler(this.useProxyCheck.isSelected());
    	crawler.setMaxDepth(Integer.parseInt(this.maxDepthField.getText()));
    	crawler.setMaxUrls(Integer.parseInt(this.maxNodeField.getText()));
    	
    	graph = crawler.getGraph();
    	crawler.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				CrawlerFoundMoreURLs();
			}
		});
    	        
    	
//        Layout<URL, Integer> layout = new FRLayout2<URL, Integer>(graph);
//		layout.setSize(new Dimension(800,800)); // sets the initial size of the layout space
//		Dimension preferredSize = new Dimension(1000,1000);
//		vs = new BasicVisualizationServer<URL, Integer>(layout, preferredSize);
//		vs.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<URL>());

    }
    double redrawCount = 1;
    public void CrawlerFoundMoreURLs(){
    	
    	//graph = crawler.getGraph();
    	Integer vertexCount = graph.getVertexCount();
    	
    	System.out.println("Found More "+vertexCount);
    	this.nodeCountLabel.setText("Node count: "+vertexCount.toString()); 	
    	
		if(vertexCount>redrawCount){
			redrawCount = redrawCount*3;
			RedrawGraph();
		}
    	
    	    	
    }
       
    private void goButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_goButtonActionPerformed
        // TODO add your handling code here:
        System.out.println("Go Button Pressed");
        setupWebCrawler();
    	
    	//jScrollPane_GraphDrawingArea.removeAll();
    	System.out.println("Starting the Crawler");
    		//Submit URL to crawler
    		try {
    			crawler.submit(this.urlField.getText());
    			drawGraph(graph);
    		} catch (MalformedURLException e) {
    			e.printStackTrace();
    		} catch (FoundMaxException e) {
    			e.printStackTrace();
    		}
    }//GEN-LAST:event_goButtonActionPerformed

    private void loadOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadOptionActionPerformed
        // TODO add your handling code here:
        LoadFrame loadFrame = new LoadFrame(this);
        loadFrame.setVisible(true);
        
    	//this.jDialog_LoadGraph.setVisible(false);
        
        System.out.println("Load Action Pressed");
    }//GEN-LAST:event_loadOptionActionPerformed

    public void loadGraph(String fname){
    	 System.out.println("Trying to load graph");
     //	int SelectedGraphIndex = loadFrame.getJlist().getSelectedIndex();
     	
   
     		DirectedGraph<URL,Integer> loadedGraph;
     		try {
 				loadedGraph = graphDB.loadCustomGraph(fname);
 				System.out.println("Graph Should now load "+fname + " graph "+loadedGraph.toString());   
 				graph = loadedGraph;
 				graphPanel.removeAll(); 
 				drawGraph(graph);

 			} catch (Exception e) {
 				System.out.println("Graph failed to load");
 				e.printStackTrace();
 				return;
 			}

    }
    
    public void saveGraph(String fname){
    	JFrame frame = new JFrame();
    	if (!fname.matches("")){
	    	if (graphDB.saveGraph(fname, graph)){
				JOptionPane.showMessageDialog(frame, "Save succeed");
			}
			else {
					JOptionPane.showMessageDialog(frame,
					"Error saving on graph","Error", 
					JOptionPane.ERROR_MESSAGE);
			}
    	}
    	else {
			JOptionPane.showMessageDialog(frame,
			"Error on saving on graph, no name entered","Error", 
			JOptionPane.ERROR_MESSAGE);
	}
    	
    }
    
    private void drawGraph(DirectedGraph<URL,Integer> graph){
    	AbstractLayout<URL,Integer> layout = new FRLayout2<URL,Integer>(graph);
         ((FRLayout2)layout).setMaxIterations(200);
			VisualizationViewer<URL,Integer> vv = new VisualizationViewer<URL,Integer>(layout, new Dimension (graphPanel.getBounds().width-20,graphPanel.getBounds().height-30) );
					
			//JRootPane rp = graphPanel.getRootPane();
	       // rp.putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
 
	        vv.setLayout(new BorderLayout());
	        vv.setBackground(java.awt.Color.white);
	        vv.setFont(new Font("Serif", Font.PLAIN, 12));
	        vv.getModel().getRelaxer().setSleepTime(500);
	        vv.setGraphMouse(new DefaultModalGraphMouse<URL,Integer>());

	        Transformer<URL, String> nodeLabelTransform = new Transformer<URL, String>(){                         
	        	public String transform(URL url) {                                 
		        		String str = url.getHost();                                 
		        		return str;                         
	        		}                 
	        	};                
	        //	VisualizationViewer.ToolTipListener test;
	      //  vv.setToolTipListener(vv);

	        //	ToolTipFunction 
	        vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);
	        vv.getRenderContext().setVertexLabelTransformer(nodeLabelTransform);

	        vv.setForeground(new java.awt.Color(0, 0, 0));
	        graphPanel.removeAll();
	       graphPanel.add(new GraphZoomScrollPane(vv));  
	       Integer vertexCount = graph.getVertexCount();
	       nodeCountLabel.setText("Node count: "+vertexCount.toString()); 
    }
    

    
//    public String nodeLabelConvert(URL url){                 
//    	String nodeName="";                 
//    	String nodeURL = url.toString();                
//    	String [] splitstring = nodeURL.split("/");                 
//    	for (String s : splitstring){                         
//    		nodeName=splitstring[2];                
//    	}                 
//    	return nodeName;         
//    } 
     
    private void RedrawGraph(){
      	System.out.println("Redrawing");

      	drawGraph(graph);
      	graphPanel.revalidate();
    }
    
    private void saveOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveOptionActionPerformed
        // TODO add your handling code here:
        SaveFrame saveFrame = new SaveFrame(this);
        saveFrame.setVisible(true);
        System.out.println("Save Action Pressed");
        
        //HACK merge to one line THIS IS NEED TO SAVE TO XML, removes "&" symbol

        //System.out.println("OLD URL "+absoluteUrl);

        //String newURL = absoluteUrl.replaceAll("&amp;", "&");

        //absoluteUrl = newURL.replaceAll("&", "&amp;");

        //System.out.println("NEW URL "+absoluteUrl);
        
    }//GEN-LAST:event_saveOptionActionPerformed

    private void placeholderActionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_placeholderActionActionPerformed
        // TODO add your handling code here:

    }//GEN-LAST:event_placeholderActionActionPerformed

    private void stopButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_stopButtonActionPerformed
        // TODO add your handling code here:
        System.out.println("Stop Button Pressed");
        crawler.pause();
    }//GEN-LAST:event_stopButtonActionPerformed

    private void advanceButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_advanceButtonActionPerformed
        // TODO add your handling code here:
        OptionFrame optionFrame = new OptionFrame();
        optionFrame.setVisible(true);
        System.out.println("Advanced Button Pressed");
    }//GEN-LAST:event_advanceButtonActionPerformed

    private void exitMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuActionPerformed
        // TODO add your handling code here:
        System.out.println("Exit Action Pressed");
        System.exit(0);
    }//GEN-LAST:event_exitMenuActionPerformed

    private void newOptionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newOptionActionPerformed
        // TODO add your handling code here:
        System.out.println("New Action Pressed");
    }//GEN-LAST:event_newOptionActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }
    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel mainPanel;
    private javax.swing.JButton advanceButton;
    private javax.swing.JLabel countLabel;
    private javax.swing.JMenuItem exitMenu;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JButton goButton;
    private javax.swing.JComboBox graphDetailComboBox;
    private javax.swing.JLabel graphDetailLabel;
    private javax.swing.JPanel graphPanel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenuItem loadOption;
    private javax.swing.JTextField maxDepthField;
    private javax.swing.JLabel maxDepthLabel;
    private javax.swing.JTextField maxNodeField;
    private javax.swing.JLabel maxNodeLabel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem newOption;
    private javax.swing.JLabel nodeCountLabel;
    private javax.swing.JLabel optionLabel;
    private javax.swing.JMenu optionMenu;
    private javax.swing.JPanel optionPanel;
    private javax.swing.JMenuItem placeholderAction;
    private javax.swing.JButton redrawButton;
    private javax.swing.JMenuItem saveOption;
    private javax.swing.JPanel statusPanel;
    private javax.swing.JButton stopButton;
    private javax.swing.JTextField urlField;
    private javax.swing.JCheckBox useProxyCheck;
    // End of variables declaration//GEN-END:variables

}
